<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  class="dialogStyleBase" :title="mixinEdit_editTitle" width="1180px" :visible.sync="mixinEdit_editVisible"
    :before-close="function(){mixinEdit_editBoxClose('editForm')}" append-to-body>

    <!-- label-width="$vFN.Constants.labelWidth" -->
    <div class="dialogStyleBaseBox"  v-loading="mixinEdit_loading">
        <el-form ref="editForm" :model="form" label-width="110px" :label-position="$vFN.Constants.labelPosition">

            <LayoutCell>
                <LayoutCellItem title="基本信息">
                    <!-- <el-form-item label="是否开启" prop="isOpen">
                        <el-radio-group v-model="form.isOpen">
                            <el-radio :label="0">关闭</el-radio>
                            <el-radio :label="1">开启</el-radio>
                        </el-radio-group>
                    </el-form-item> -->

                    <el-form-item label="优惠类型" prop="couponType" :rules="{ required: true, message: '优惠类型 不能为空'}">
                        <el-radio-group v-model="form.couponType" :disabled="isDisabled" @change="radioChange">
                            <el-radio :label="1">代金券</el-radio>
                            <el-radio :label="2">折扣券</el-radio>
                            <el-radio :label="3">兑换券</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="优惠券标题" prop="couponName" :rules="{ required: true, message: '优惠券标题 不能为空'}">
                        <el-input v-model="form.couponName" maxlength="9" show-word-limit placeholder="请输入优惠券名称">
                        </el-input>
                    </el-form-item>
                    <el-form-item label="券描述" prop="couponDesc" placeholder="仅商家端显示，可以区分相似券">
                        <el-input v-model="form.couponDesc" :disabled="isDisabled" placeholder="请输入优惠券描述"></el-input>
                    </el-form-item>
                    <el-form-item label="使用时间">
                        <el-radio-group v-model="form.expireType" :disabled="isDisabled">
                            <el-radio :label="1">固定时间</el-radio>
                            <el-radio :label="2">领取后生效</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if="form.expireType==1" label="时间范围">
                        <div class="box">
                            <span>
                                <el-form-item :rules="{ required: true, message: '请选择开始时间'}" prop="startTimeStr">
                                    <el-date-picker v-model="form.startTimeStr" type="datetime" :disabled="isDisabled"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
                                    </el-date-picker>
                                </el-form-item>
                            </span>
                            <span class="cut">至</span>
                            <span>
                                <el-form-item :rules="{ required: true, message: '请选择结束时间'}" prop="endTimeStr">
                                    <el-date-picker v-model="form.endTimeStr" type="datetime" :disabled="isDisabled"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
                                    </el-date-picker>
                                </el-form-item>
                            </span>
                        </div>
                        <!-- <el-col :span="11">
                            
                        </el-col>
                        <el-col :span="1">-</el-col>
                        <el-col :span="8">
                            <el-form-item :rules="{ required: true, message: '请选择结束时间'}" prop="endTimeStr">
                                <el-date-picker v-model="form.endTimeStr" type="datetime" :disabled="isDisabled"
                                    value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
                                </el-date-picker>
                            </el-form-item>
                        </el-col> -->
                        <!-- <el-date-picker v-model="timeArr" type="datetimerange" range-separator="至"
                            start-placeholder="开始时间" end-placeholder="结束时间" :disabled="isDisabled">
                        </el-date-picker> -->
                    </el-form-item>
                    <el-form-item v-if="form.expireType==2" label="有效天数" prop="validDays"
                        :rules="{ required: true, message: '有效天数 不能为空'}">
                        <el-input-number v-model="form.validDays" controls-position="right" @change="handleChange"
                            :disabled="isDisabled" :min="1"></el-input-number>
                        天
                    </el-form-item>
                    <el-form-item label="库存" prop="stock" :rules="{ required: true, message: '库存 不能为空'}">
                        <el-input-number v-model="form.stock" controls-position="right" @change="handleChange"
                            :disabled="isDisabled" :min="1"></el-input-number> 张
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="优惠规则">
                    <el-form-item label="使用门槛" prop="useOrderAmount" :rules="{ required: true, message: '使用门槛 不能为空'}">
                        <el-input-number v-model="form.useOrderAmount" controls-position="right" :disabled="isDisabled"
                            :min="1"></el-input-number>
                        <span style="margin-left: 10px;">元</span>
                    </el-form-item>
                    <el-form-item v-if="form.couponType !== 3" label="减免金额" prop="discountAmount"
                        :rules="{ required: true, message: '减免金额 不能为空'}">
                        <el-input-number v-model="form.discountAmount" controls-position="right" :disabled="isDisabled"
                            :min="1" :max="form.couponType == 2 ? 10:'Infinity'">
                        </el-input-number>
                        <span v-if="form.couponType == 1" style="margin-left: 10px;">元</span>
                        <span v-if="form.couponType == 2" style="margin-left: 10px;">折</span>

                    </el-form-item>

                </LayoutCellItem>

                <LayoutCellItem title="使用规则">
                    <el-form-item label="适用商品">
                        <!-- // 应用类型 1全部商品 2商品分组 3商品分类 4指定商品 -->
                        <el-radio-group v-model="form.applyType" :disabled="isDisabled">
                            <el-radio :label="1">全部商品</el-radio>
                            <el-radio :label="4">指定商品</el-radio>
                            <el-radio :label="2">指定分组</el-radio>
                            <el-radio :label="3">指定分类</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="指定商品" v-if="form.applyType==4" prop="couponProductLst"
                        :rules="{ required: true, message: '商品 不能为空'}">
                        <SelectDataGoods v-model="form.couponProductLst" :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoods',appWindow)">
                        </SelectDataGoods>
                    </el-form-item>
                    <el-form-item label="指定分组" v-if="form.applyType==2" prop="couponProductGroupsLst"
                        :rules="{ required: true, message: '分组 不能为空'}">
                        <SelectDataGoodsGroup style="width:420px" v-model="form.couponProductGroupsLst"
                            :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoodsGroup',appWindow)">
                        </SelectDataGoodsGroup>
                    </el-form-item>
                    <el-form-item label="指定分类" v-if="form.applyType==3" prop="couponProductCategoryLst"
                        :rules="{ required: true, message: '分类 不能为空'}">
                        <SelectDataGoodsClassify style="width:420px" v-model="form.couponProductCategoryLst"
                            :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoodsClassify',appWindow)">
                        </SelectDataGoodsClassify>
                    </el-form-item>
                    <el-form-item label="下单可用抵扣" prop="deductOverlayLst">
                        <el-checkbox-group v-model="form.deductOverlayLst">
                            <el-checkbox v-for="item in deducteList" :label="item.id" :checked="item.isChecked">
                                {{item.name}}
                            </el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="发放规则">
                    <el-form-item label="每人限领" prop="limitCount">
                        <el-input-number v-model="form.limitCount" controls-position="right" :disabled="isDisabled"
                            :min="1"></el-input-number>
                        <span style="margin-left: 10px;">张</span>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="信息说明">
                    <el-form-item label="领取说明" prop="useNote">
                        <el-input type="textarea" :rows="2" v-model="form.useNote" placeholder="领取说明"></el-input>
                    </el-form-item>
                    <el-form-item label="优惠说明" prop="discountNote" :rules="{ required: true, message: '优惠说明 不能为空'}">
                        <el-input type="textarea" :rows="2" v-model="form.discountNote" :disabled="isDisabled"
                            placeholder="兑换券满足门槛即可使用"></el-input>
                    </el-form-item>
                    <el-form-item label="使用须知" prop="useRuleNote" :rules="{ required: true, message: '使用须知 不能为空'}">
                        <el-input type="textarea" :rows="2" v-model="form.useRuleNote" placeholder="满多少元可用"></el-input>
                    </el-form-item>
                </LayoutCellItem>

            </LayoutCell>


        </el-form>
    </div>

    <div slot="footer">
        <el-row>
            <!-- <el-col :span="12" style="text-align: left;">
                <el-button @click="mixinEdit_resetForm('editForm')">重 置</el-button>
            </el-col> -->
            <el-col :span="24">
                <el-button @click="mixinEdit_editBoxClose('editForm')">取 消</el-button>
                <el-button type="primary" @click="mixinEdit_editFormSubmit({model:'form',ref:'editForm'})"
                     :disabled="mixinEdit_loading">确定</el-button>
            </el-col>
        </el-row>
    </div>

</el-dialog>